﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;

namespace RBAC.Administry
{
    public class Global : System.Web.HttpApplication
    {
        protected void Application_Error(object sender, EventArgs e)
        {
            Exception ex = Server.GetLastError().GetBaseException(); 
            Session.Add("_exception_", ex);
            HttpContext.Current.Server.Transfer("~/Error.aspx");

            // the error will be clear in error.aspx
        }
    }
}